import TLSSigAPIv2 from 'tls-sig-api-v2'
import clientConfig from '@/config/clientConfig'

const { sdkAppId, secretKey, mode } = clientConfig

const EXPIRES = 604800 // 7 x 24 x 60 x 60 = 604800 = 7 天

export default function(userId) {
  var api = new TLSSigAPIv2.Api(sdkAppId, secretKey)
  var userSig = api.genSig(userId, EXPIRES)

  return {
    sdkAppId,
    userId,
    userSig,
    mode
  }
}
